package com.he.commandmodel;

import com.he.commandmodel.command.concretecommand.BakedChickenWingsCommand;
import com.he.commandmodel.invoker.BarbecueReciver;
import com.he.commandmodel.reciver.WaiterReciver;

public class Client {
    public static void main(String[] args) {
        /**
         * 指定要去的烧烤店
         */
        BarbecueReciver barbecueReciver = new BarbecueReciver();
        /**
         * 叫服务员点单
         */
        WaiterReciver waiterReciver = new WaiterReciver();
        BakedChickenWingsCommand command = new BakedChickenWingsCommand(barbecueReciver);
        waiterReciver.add(command);
        waiterReciver.add(new BakedChickenWingsCommand(barbecueReciver));
        waiterReciver.add(new BakedChickenWingsCommand(barbecueReciver));
        /**
         * 跟服务员说第一个鸡翅不要了
         */
        waiterReciver.remove(command);
        /**
         * 服务员通知烧烤师傅
         */
        waiterReciver.notifyCommandList();
    }
}
